@(posts:List[models.my.MyPosts],uis: List[models.user.UserInfo])
@js_css={
<script type="text/javascript">
	$(document).ready(function(){
		$("#textarea").change(function(){
			var content = $("#textarea").val();
			if(content.trim().length >= 5){
				$("#pbtn").removeClass("disabled");
			}
			if(content.trim().length < 5){
				$("#pbtn").addClass("disabled");
			}
		});
	});
</script>
}
@import utils.StringUtils
@main("个人首页",js_css) {
@left()    
<div class="col-xs-7">
    <div class="panel panel-default">
        <div class="panel-body">
            <form class="form-horizontal" method="post" action="/myposts/create">
                <fieldset>
                    <legend>说几句</legend>
                    <div class="form-group">
                        <div class="col-lg-10">
                            <textarea class="form-control" rows="2" id="textarea" name="content" placeholder="发布的内容不少于5个字"></textarea>
                        </div>
                        <div class="col-lg-2">
                            <button type="submit" id="pbtn" class="btn btn-primary btn-lg disabled">发布</button>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>

	@for(post <- posts){
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="list-group">
                <a href="#" class="list-group-item">
                    <h4 class="list-group-item-heading">@post.username 发表的:</h4>

                    <p class="list-group-item-text">@post.content</p>
                </a>
            </div>
        </div>
        <div class="panel-footer">发布于: @StringUtils.convertStanderDate(post.create_at)</div>
    </div>
	}
</div> 
@right(uis)   
}
